package com.emep.changzhi.analyse.repository.basics;

import com.emep.changzhi.analyse.entity.basics.SysAreaInfo;
import com.emep.changzhi.analyse.entity.basics.SysCompanyInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author Wangcc
 * @version V1.0
 * @Description: TODO
 * @date 2018/2/27 15:59
 */
public interface SysCompanyInfoRepository extends BaseRepository<SysCompanyInfo,Long>{

    @Modifying
    @Transactional
    Integer deleteSysCompanyInfoById(String id);

    SysCompanyInfo findSysCompanyInfoById(String id);

    Page<SysCompanyInfo> findAll(Specification<SysCompanyInfo> spec, Pageable pageable);

    List<SysCompanyInfo> findSysCompanyInfosBySysAreaInfos(SysAreaInfo sysAreaInfo);

    List<SysCompanyInfo> findAllByCompanyNameAndIdIsNotAndIsDelete(String companyname,String id,String isdelete);
}
